package net.tycmc.cty.ctyms.timejob.iems.dao;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import net.tycmc.bulb.common.dao.IBaseDAO;
import net.tycmc.bulb.common.dao.ITransactionDAO;
import net.tycmc.bulb.common.util.CurrentDate;
import net.tycmc.bulb.common.util.DateUtil;
import net.tycmc.bulb.common.util.MapGetter;
import net.tycmc.bulb.common.util.StringUtil;
import net.tycmc.cty.ctyms.timejob.common.DateList;
import net.tycmc.cty.ctyms.timejob.common.EquipVersionCommon;
import net.tycmc.cty.ctyms.timejob.common.SMSCfgType;
import net.tycmc.cty.ctyms.timejob.common.SMSContentCfg;
import net.tycmc.cty.ctyms.timejob.common.SMSPromptType;

/**
 * 载重提醒DAO
 * @author chengshichao
 * 创建时间：2012-11-7
 */
public class LoadAwokeDAO {

	private IBaseDAO baseDAO;
	
	private ITransactionDAO tranDAO;
	
	private VehicleInfoDAO vclInfoDAO;
	
	private SMSInfoDAO smsInfoDAO;
	
	/**
	 * @return the baseDAO
	 */
	public IBaseDAO getBaseDAO() {
		return baseDAO;
	}

	/**
	 * @param baseDAO the baseDAO to set
	 */
	public void setBaseDAO(IBaseDAO baseDAO) {
		this.baseDAO = baseDAO;
	}

	/**
	 * @return the tranDAO
	 */
	public ITransactionDAO getTranDAO() {
		return tranDAO;
	}

	/**
	 * @param tranDAO the tranDAO to set
	 */
	public void setTranDAO(ITransactionDAO tranDAO) {
		this.tranDAO = tranDAO;
	}

	/**
	 * @return the vclInfoDAO
	 */
	public VehicleInfoDAO getVclInfoDAO() {
		return vclInfoDAO;
	}

	/**
	 * @param vclInfoDAO the vclInfoDAO to set
	 */
	public void setVclInfoDAO(VehicleInfoDAO vclInfoDAO) {
		this.vclInfoDAO = vclInfoDAO;
	}

	/**
	 * @return the smsInfoDAO
	 */
	public SMSInfoDAO getSmsInfoDAO() {
		return smsInfoDAO;
	}

	/**
	 * @param smsInfoDAO the smsInfoDAO to set
	 */
	public void setSmsInfoDAO(SMSInfoDAO smsInfoDAO) {
		this.smsInfoDAO = smsInfoDAO;
	}

	/**
	 * 统计入口
	 * @return
	 */
	public void startAwoke(){
		
		//检索的表名后缀（日期）
		String tableDateName = "";
		//检索的标记的表主键
		double msgT_IDSign;
		//检索载重监控提醒标记表，MsgLAS_StatType：1代表载重监控提醒
		String strSQL = "select * from Msg_LoadAwokeSign where MsgLAS_StatType=1";
		Map<String,Object> map = baseDAO.execQueryOne(strSQL, new Object[]{});
		
		if(StringUtil.isNullOrEmpty(MapGetter.getString(map, "MsgLAS_MsgT_ID"))
				&&StringUtil.isNullOrEmpty(MapGetter.getString(map, "MsgLAS_PreStatTime"))){

			//比较当前日期与上次统计日期的大小
			if(CurrentDate.getCurrentDate().getTime()
					-MapGetter.getDate(map, "MsgLAS_PreStatTime").getTime()>0){//当前日期大于上次统计日期
				
				//分两步统计
				
				//1.上次统计遗留数据
				tableDateName = DateUtil.toString(DateUtil.toDate(MapGetter.getString(map, "MsgLAS_PreStatTime"), "yyyy-MM-dd"),"yyyyMMdd");
				if(StringUtil.isNullOrEmpty(MapGetter.getString(map, "MsgLAS_MsgT_ID"))){
					msgT_IDSign = Double.parseDouble(MapGetter.getString(map, "MsgLAS_MsgT_ID"));
					//获取数据
					List<Map<String,Object>> preList = this.getTeamLoadMonitorList(tableDateName,msgT_IDSign);
					Double tmpd = this.getMsgTimingId(preList);
					if(tmpd!=null){
						//更新标记ID
						msgT_IDSign = tmpd.doubleValue();
						//更新提醒标记表
						this.oprtAwokeSign(CurrentDate.getStringDateLong(), msgT_IDSign);
						//统计分析获取数据
						this.judgeData(preList);
					}
				}
				
				//2.今日数据
				tableDateName = DateUtil.addDay(0).replace("-", "");
				msgT_IDSign = 0;
				//获取数据
				List<Map<String,Object>> curList = this.getTeamLoadMonitorList(tableDateName,msgT_IDSign);
				Double tmpd2 = this.getMsgTimingId(curList);
				if(tmpd2!=null){
					//更新标记ID
					msgT_IDSign = tmpd2.doubleValue();
					//更新提醒标记表
					this.oprtAwokeSign(CurrentDate.getStringDateLong(), msgT_IDSign);
					//统计分析获取数据
					this.judgeData(curList);
				}
				
			}else{
				
				//执行更新一次
				tableDateName = DateUtil.addDay(0).replace("-", "");
				if(StringUtil.isNullOrEmpty(MapGetter.getString(map, "MsgLAS_MsgT_ID"))){
					msgT_IDSign = Double.parseDouble(MapGetter.getString(map, "MsgLAS_MsgT_ID"));
					//获取数据
					List<Map<String,Object>> curList = this.getTeamLoadMonitorList(tableDateName,msgT_IDSign);
					Double tmpd = this.getMsgTimingId(curList);
					if(tmpd!=null){
						//更新标记ID
						msgT_IDSign = tmpd.doubleValue();
						//更新提醒标记表
						this.oprtAwokeSign(CurrentDate.getStringDateLong(), msgT_IDSign);
						//统计分析获取数据
						this.judgeData(curList);
					}
				}
			}
			
		}
	}
	
	/**
	 * 获取载重监控信息
	 * @param tableDateName
	 * @param msgT_IDSign
	 * @return
	 */
	public List<Map<String,Object>> getTeamLoadMonitorList(String tableDateName,double msgT_IDSign){
		StringBuffer strBuffSQL = new StringBuffer();
		strBuffSQL.append("select MsgT_ID,VehicleID,VehicleNumber,");
		strBuffSQL.append("LoadVal = case when (MsgT_Load_UDS between VclLI_BgnNoLoad and VclLI_EndNoLoad) then MsgT_Load_UDS*ISNULL(VclLI_NoLoadRegM,1)+ISNULL(VclLI_NoLoadRegR,0) ");
		strBuffSQL.append("when (MsgT_Load_UDS between VclLI_BgnLoad and VclLI_EndLoad) then MsgT_Load_UDS*ISNULL(VclLI_LoadRegM,1)+ISNULL(VclLI_LoadRegR,0) ");
		strBuffSQL.append("when (MsgT_Load_UDS between VclLI_BgnFullLoad and VclLI_EndFullLoad) then MsgT_Load_UDS*ISNULL(VclLI_FullLoadRegM,1)+ISNULL(VclLI_FullLoadRegR,0) ");
		strBuffSQL.append("when (MsgT_Load_UDS between VclLI_BgnSpeFullLoad and VclLI_EndSpeFullLoad) then MsgT_Load_UDS*ISNULL(VclLI_SpeFulLLoadRegM,1)+ISNULL(VclLI_SpeFulLLoadRegR,0) else MsgT_Load_UDS end, ");
		strBuffSQL.append("ISNULL(VclPL_Lo,'')VclPL_Lo,ISNULL(VclPL_La,'')VclPL_La,Tmnl_SoftEdition,");
		strBuffSQL.append("MsgLMS_SetLoad,MsgT_MsgTime ");
		strBuffSQL.append("from CTY_Egn_B.dbo.Msg_Timing_"+tableDateName+" mtl ");
		strBuffSQL.append("left join  V_VehicleInfo vvi on mtl.MsgT_Vcl_ID=VehicleID ");
		strBuffSQL.append("left join CTY_Vcl.dbo.Vcl_Pstn_Last vpl on vpl.VclPL_Vcl_ID=VehicleID ");
		strBuffSQL.append("left join Msg_LoadMonitorSet on MsgLMS_Vcl_ID=VehicleID ");
		strBuffSQL.append("left join Vcl_LoadInfo on VclLI_VclId=MsgT_Vcl_ID ");
		strBuffSQL.append("where UsefulLife>=GETDATE() and Tmnl_SoftEdition is not null and Tmnl_SoftEdition!='' ");
		strBuffSQL.append("and MsgLMS_SetStatus is not null and MsgLMS_SetStatus=1 and MsgT_Load_UDS is not null ");
		strBuffSQL.append("and MsgLMS_SetLoad is not null ");//设置载重不能为NULL
		strBuffSQL.append("and MsgT_Load_UDS is not null ");//设备载重不能为NULL
		strBuffSQL.append("and MsgT_SysTI_ID!=4 ");//关机固定间隔信息除外
		strBuffSQL.append("and MsgT_ID>? ");
		//通过协议类型获取软件版本号
		String termJPPSoft =  EquipVersionCommon.getSoftVerByAgrType("LAVcl_JPP");
		String termPPSoft =  EquipVersionCommon.getSoftVerByAgrType("LAVcl_PP");
		StringBuffer termSoft = new StringBuffer(termJPPSoft);
		if(StringUtil.isNullOrEmpty(termPPSoft)){
			if(StringUtil.isNullOrEmpty(termSoft.toString()))termSoft.append(",");
			termSoft.append(termPPSoft);
		}
		strBuffSQL.append("and Tmnl_SoftEdition in ("+termSoft.toString()+") order by MsgT_ID asc");
		List<Map<String,Object>> list = baseDAO.execQuery(strBuffSQL.toString(), new Object[]{msgT_IDSign});
		return list;
	}
	
	/**
	 * 获取载重信息最大ID
	 * @param dataList ID正序
	 * @return
	 */
	public Double getMsgTimingId(List<Map<String,Object>> dataList){
		Double retValue = null;
		if(dataList!=null&&dataList.size()>0){
			retValue = Double.valueOf(MapGetter.getString(dataList.get(dataList.size()-1), "MsgT_ID"));
		}
		return retValue;
	}
	
	/**
	 * 数据判断
	 * @param list
	 */
	public void judgeData(List<Map<String,Object>> list){
		
		if(list==null||list.size()==0)return ;
		
		Map<String,Object> nowLoadMap = new HashMap<String,Object>();//当前载重，遍历设备时每次变更均需进行更新
		Map<String,List<Map<String,Object>>> loadSetMap = new HashMap<String,List<Map<String,Object>>>();//当前载重设定范围
		
		List<Map<String,Object>> setList = new ArrayList<Map<String,Object>>();
		float setLoad = 0;
		
		//jiyongtian20130805无效数据过滤
		Map<String,float[]> loadInvalid = new HashMap<String,float[]>();
		float[] invalid = new float[2]; 
		
		for(Map<String,Object> map:list){
			
			if(!loadSetMap.containsKey(MapGetter.getString(map, "VehicleID"))){
				List<Map<String,Object>> loadSetList = this.getLoadSet(MapGetter.getString(map, "VehicleID"));
				loadSetMap.put(MapGetter.getString(map, "VehicleID"), loadSetList);
				//添加载重设定时获取无效数据范围
				loadInvalid.put(MapGetter.getString(map, "VehicleID"), this.getLoatSetInvalid(MapGetter.getString(map, "VehicleID")));
			}
			setList = loadSetMap.get(MapGetter.getString(map, "VehicleID"));
			if(setList==null||setList.size()==0)continue;
			
			invalid = loadInvalid.get(MapGetter.getString(map,"VehicleID"));
			if(invalid.length==0){
				invalid = this.getLoatSetInvalid(MapGetter.getString(map, "VehicleID"));
			}
			
			int curStatusVal = 0;
			int preStatusVal = 0;
			
			if(!nowLoadMap.containsKey(MapGetter.getString(map, "VehicleID"))){
				nowLoadMap.put(MapGetter.getString(map, "VehicleID"), MapGetter.getString(map, "MsgLMS_SetLoad"));
			}
			setLoad = Float.parseFloat(MapGetter.getString(nowLoadMap, MapGetter.getString(map, "VehicleID")));
			
			int i = 0;
			for(Map<String,Object> setMap:setList){
				if(StringUtil.isNullOrEmpty(MapGetter.getString(setMap, "bgnLoad"))
						&&StringUtil.isNullOrEmpty(MapGetter.getString(setMap, "endLoad"))
						&&StringUtil.isNullOrEmpty(MapGetter.getString(map, "LoadVal"))){
					try{
						float bgnLoad = Float.parseFloat(MapGetter.getString(setMap, "bgnLoad"));
						float endLoad = Float.parseFloat(MapGetter.getString(setMap, "endLoad"));
						float curLoadVal = Float.parseFloat(MapGetter.getString(map, "LoadVal"));
						float preLoadVal = setLoad;
						if(i==0){
							if(preLoadVal>=bgnLoad&&preLoadVal<=endLoad&&(preLoadVal<invalid[0]||preLoadVal>invalid[1])){
								preStatusVal = MapGetter.getInt(setMap, "statusVal");
							}
							if(curLoadVal>=bgnLoad&&curLoadVal<=endLoad&&(curLoadVal<invalid[0]||curLoadVal>invalid[1])){
								curStatusVal = MapGetter.getInt(setMap, "statusVal");
							}
						}else{
							if(preLoadVal>bgnLoad&&preLoadVal<=endLoad&&(preLoadVal<invalid[0]||preLoadVal>invalid[1])){
								preStatusVal = MapGetter.getInt(setMap, "statusVal");
							}
							if(curLoadVal>bgnLoad&&curLoadVal<=endLoad&&(curLoadVal<invalid[0]||curLoadVal>invalid[1])){
								curStatusVal = MapGetter.getInt(setMap, "statusVal");
							}
						}
					}catch(Exception e){
						e.printStackTrace();
					}
				}else{
					break;
				}
				i++;
			}
			//判断当前载重量是否与之前载重量一致，不一致则进行提醒
			if(preStatusVal!=curStatusVal&&preStatusVal!=0&&curStatusVal!=0){
				//获取短信接收人
				//获取设备信息
				Map<String,Object> vclInfoMap = vclInfoDAO.getVclInfoByVclID(MapGetter.getString(map, "VehicleID"));
				// 获取设备组织机构
				String DBCode =MapGetter.getString(vclInfoMap, "DBCode");
				String VehicleID = MapGetter.getString(map, "VehicleID");
				List<Map<String,Object>> userList = smsInfoDAO.getSMSUsers("SMSAS_SMSLoad", DBCode, VehicleID);
				this.istLoadAwoke(MapGetter.getString(map, "VehicleID"), MapGetter.getString(map, "VclPL_Lo"),
						MapGetter.getString(map, "VclPL_La"), String.valueOf(setLoad), 
						MapGetter.getString(map, "LoadVal"), preStatusVal,curStatusVal,userList,MapGetter.getString(map, "MsgT_MsgTime"));
				nowLoadMap.put(VehicleID, MapGetter.getString(map, "LoadVal"));
			}
		}
	}
	/**获取载重设置的无效范围*/
	private float[] getLoatSetInvalid(String vclId) {
		float[] invalidload = new float[2];
		String SQL="select vl.VclLI_BgnInvalid,vl.VclLI_EndInvalid from Vcl_LoadInfo vl where vl.VclLI_VclId = '"+vclId+"';";
		Map<String,Object> invalid = baseDAO.execQueryOne(SQL, new Object[]{});
		
		if(StringUtil.isValid(MapGetter.getString(invalid, "VclLI_BgnInvalid"))){
			invalidload[0] = Float.parseFloat(MapGetter.getString(invalid, "VclLI_BgnInvalid"));
		}else{
			invalidload[0] = -1;
		}
		
        if(StringUtil.isValid(MapGetter.getString(invalid, "VclLI_EndInvalid"))){
			invalidload[1] = Float.parseFloat(MapGetter.getString(invalid, "VclLI_EndInvalid"));
		}else{
			invalidload[1] = -1;
		}
        if(invalidload[0]>invalidload[1]){
        	float temp = invalidload[0];
        	invalidload[0] = invalidload[1];
        	invalidload[1] = temp;
        }
		return invalidload;
	}

	/**
	 * 获取载重设置信息
	 * @param vclID
	 * @param loadType
	 * @return
	 */
	public List<Map<String,Object>> getLoadSet(String vclId){
		StringBuffer strBuffSQL = new StringBuffer();
		strBuffSQL.append("select * from (select VclLI_VclId,ISNULL(VclLI_BgnNoLoad,0)bgnLoad,ISNULL(VclLI_EndNoLoad,0) endLoad,1 statusVal from Vcl_LoadInfo union ");
		strBuffSQL.append("select VclLI_VclId,ISNULL(VclLI_BgnLoad,0),ISNULL(VclLI_EndLoad,0),2 statusVal from Vcl_LoadInfo union ");
		strBuffSQL.append("select VclLI_VclId,ISNULL(VclLI_BgnFullLoad,0),ISNULL(VclLI_EndFullLoad,0),3 statusVal from Vcl_LoadInfo union ");
		strBuffSQL.append("select VclLI_VclId,ISNULL(VclLI_BgnSpeFullLoad,0),ISNULL(VclLI_EndSpeFullLoad,0),4 statusVal from Vcl_LoadInfo) tmp where tmp.VclLI_VclId=?");
		List<Map<String,Object>> list = baseDAO.execQuery(strBuffSQL.toString(), new Object[]{vclId});
		return list;
	}
	
	/**
	 * 操作提醒标记表
	 * @param preStatTime
	 * @param msgT_IDSign
	 * @param oprtType
	 * @return
	 */
	public boolean oprtAwokeSign(String curStatTime,double msgT_IDSign){
		String strSQL = "update Msg_LoadAwokeSign set MsgLAS_MsgT_ID="+msgT_IDSign+",MsgLAS_PreStatTime='"+curStatTime+"' where MsgLAS_StatType=1;";
		int iFlag = baseDAO.execUpdate(strSQL, new Object[]{});
		if(iFlag>0)return true;
		return false;
	}
	
	/**
	 * 插入载重监控提醒信息
	 * @param vclId
	 * @param lng
	 * @param lat
	 * @param bgnLoad
	 * @param endLoad
	 * @param bgnStatusVal
	 * @param endStatusVal
	 * @return
	 */
	public boolean istLoadAwoke(String vclId,String lng,String lat,String bgnLoad,String endLoad,int bgnStatusVal,int endStatusVal,List<Map<String,Object>> userList,String msgTime){
		StringBuffer strBuffSQL = new StringBuffer();
		//1.插入载重提醒表
		strBuffSQL.append("insert into Msg_LoadAwoke(MsgLA_Vcl_ID,MsgLA_MsgTime,MsgLA_Lng,MsgLA_Lat,MsgLA_BgnLoad,MsgLA_AftLoad,MsgLA_BgnStatusVal,MsgLA_AftStatusVal)");
		strBuffSQL.append("values(?,GETDATE(),?,?,?,?,?,?);");
		
		//2.插入统一提示信息表
//		String strSqlPrompt = "insert into Msg_Prompt(MsgP_VclID,MsgP_MsgID,MsgP_MsgCID,MsgP_MsgTime,MsgP_Type,MsgP_DBName,MsgP_TableName,MsgP_UpdateTime,MsgP_CreateTime)" +
//				"values(?,IDENT_CURRENT('Msg_LoadAwoke'),IDENT_CURRENT('Msg_LoadAwoke'),GETDATE(),?,?,?,GETDATE(),GETDATE());";
		/**2013.03.27 haoyang 修改 begin*/
		/**2015.01.12  SXH 修改 载重监控提醒取消插入提示表*/
		/*String strSqlPrompt = "insert into Msg_Prompt(MsgP_VclID,MsgP_MsgID,MsgP_MsgCID,MsgP_MsgTime,MsgP_Type,MsgP_DBName,MsgP_TableName,MsgP_UpdateTime,MsgP_CreateTime" +
				",MsgP_DetailMsg,MsgP_SecTypeId,MsgP_SecTypeName,MsgP_SMSRecUser,MsgP_Lo,MsgP_La)" +
				"values(?,IDENT_CURRENT('Msg_LoadAwoke'),IDENT_CURRENT('Msg_LoadAwoke'),GETDATE(),?,?,?,GETDATE(),GETDATE(),?,?,?,?,?,?);";*/
		Map<String,Object> loadMsg = getLoadMsg(bgnStatusVal,endStatusVal);
		String recUsers = smsInfoDAO.getSMSUsers(userList);
		if(StringUtil.isNullOrEmpty(recUsers))
			recUsers ="，"+recUsers;
		/**end*/
		List<String> sqlList = new ArrayList<String>();
		sqlList.add(strBuffSQL.toString());
		//sqlList.add(strSqlPrompt);
		List<Object[]> paramList = new ArrayList<Object[]>();
		paramList.add(new Object[]{vclId,lng,lat,bgnLoad,endLoad,bgnStatusVal,endStatusVal});
//		paramList.add(new Object[]{vclId,SMSPromptType.SMSLoad,"M","LoadAwoke"});
		//haoyang 修改
		/*paramList.add(new Object[]{vclId,SMSPromptType.SMSLoad,"M","LoadAwoke",
				MapGetter.getString(loadMsg, "MsgP_DetailMsg")
				,MapGetter.getString(loadMsg, "MsgP_SecTypeId")
				,MapGetter.getString(loadMsg, "MsgP_SecTypeName")
				,recUsers,lng,lat});*/
		//获取设备信息
		Map<String,Object> vclInfoMap = vclInfoDAO.getVclInfoByVclID(vclId);
		//短信信息
		Map<String,Object> SMSMap = new HashMap<String,Object>();
		SMSMap.put("SMSType", "SMSAS_SMSLoad");
		SMSMap.put("TabName", "Msg_LoadAwoke");
		SMSMap.put("TabNameShort", "LoadAwoke");
		//短信内容
		String SMSContent = SMSContentCfg.SMSCCfgLoad;
		SMSContent = SMSContent.replace(SMSContentCfg.X_VclNum, MapGetter.getString(vclInfoMap, "VehicleNumber"))
						.replace(SMSContentCfg.X_Date, DateList.getFormatDate(msgTime,5))
						.replace(SMSContentCfg.X_BgLoadStatus, this.getLoadStatusName(bgnStatusVal))
						.replace(SMSContentCfg.X_EndLoadStatus, this.getLoadStatusName(endStatusVal));
		SMSMap.put("SMSContent", SMSContent);
		SMSMap.put("PromptType", SMSPromptType.SMSLoad);
		SMSMap.put("CreateType", "1");
		SMSMap.put("DBName", "M");
		SMSMap.put("SMSCfgType", SMSCfgType.SMSCfgLoad);
		SMSMap.put("DBCode", vclInfoMap.get("DBCode"));
		/**IEMS3.0 注释短信发送*/
		//注:若发送,则需同步修改提示信息表中的短信接收人列
		smsInfoDAO.loadSMSInfo(sqlList, paramList, SMSMap,userList);
		//3.更新载重监控信息表
		sqlList.add("update Msg_LoadMonitorSet set MsgLMS_SetLoad=?,MsgLMS_SetTime=GETDATE() where MsgLMS_Vcl_ID=?");
		paramList.add(new Object[]{endLoad,vclId});
		
		//邮件发送----------改为日报，不实时发送------------------------
		
//		String mailSuje = MailCfg.getMailSujeInfo(MapGetter.getString(vclInfoMap, "VehicleNumber"),
//				msgTime, MailCfg.MailSujeLoad); //邮件主题初始化
//		
//		String mailContent = SMSContent;//邮件内容初始化
//		
//		SendMail.getInstance().sendMail(mailSuje, mailContent, userMailList, "Email");//发送邮件，暂未对发送状态进行判断处理
		
		//邮件发送----------------------------------
		
		boolean flag = tranDAO.batch(sqlList, paramList);
		return flag;
	}
	
	public String getLoadStatusName(int statusVal){
		String statusName = "";
		switch (statusVal){
			case 1:
				statusName = "空载";
				break;
			case 2:
				statusName = "装载";
				break;
			case 3:
				statusName = "满载";
				break;
			case 4:
				statusName = "特满载";
				break;
		}
		return statusName;
	}
	/**
	 * 根据提醒前后状态值,获取相应的载重信息
	 * @param bgnStatusVal
	 * @param endStatusVal
	 * @return
	 */
	public Map<String,Object> getLoadMsg(int bgnStatusVal,int endStatusVal){
		Map<String ,Object> msg = new HashMap<String,Object>();
		String bgnSName = getLoadStatusName(bgnStatusVal);//提醒前 状态名称
		String endSName = getLoadStatusName(endStatusVal);//提醒后 状态名称
		msg.put("MsgP_DetailMsg", bgnSName+"→"+endSName);
		msg.put("MsgP_SecTypeId",endStatusVal );//二级类别 id,用于查询条件
		msg.put("MsgP_SecTypeName",endSName );//二级类别名称
		return msg;
	}
	
}
